package com.erpservertwo.controller.menu;


import com.erpservertwo.entity.Emp;
import com.erpservertwo.entity.Menu;
import com.erpservertwo.entity.MenuData;
import com.erpservertwo.service.MenuService;
import com.erpservertwo.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@Api("侧边拦相关")
@Slf4j
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("select")
    @ApiOperation("侧边栏")
    public Result<List<MenuData>>select(HttpSession session) {
        Emp emp = (Emp) session.getAttribute("emp");
        List<MenuData> menuDataList=menuService.select(emp.getUuid());
return Result.success();
    }
}
